<template>
  <div class="maskCenter">
    <div :class="visible?'open-content':'open-content-hide'" style="width: auto;overflow-y: auto;position: fixed;" :style="'height:'+winheight+'px;width:'+winwidth+'px;'">
      <div class="dialog-header" v-movew>
        <span>{{title}}</span>
        <el-tooltip class="item" effect="dark" content="关闭" placement="top-start">
          <span class="icon iconfont iconbiaoqianlan-guanbi close" @click="hide"></span>
        </el-tooltip>
      </div>
      <div class="dialog-body">
        <img width="100%" :src="src" alt="">
      </div>      
    </div>
  </div>
</template>

<script>
import movew from "@/directives/winmove";
import { deepCopy } from "@/utils/public";
export default {
  directives: { movew },
  name: "winImg",
  props: {
    title: { default: "图片" },
    src: { default: "" },
  },
  data() {
    return {
      visible:true,
      winheight:800,
      winwidth:800
    };
  },
  mounted() {
    this.winheight = document.documentElement.clientHeight - 100;
//  this.winwidth = document.documentElement.clientWidth - 100;
  },
  methods: {
    hide() {
      this.visible = false;
      setTimeout(() => {
        this.$emit("close");
      }, 400);
    },    
  },
};
</script>

<style scoped>
.mask {
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
}

/*表单背景宽高设置*/
	.open-content {				
	    width: 100%;	   
	    box-shadow: 0px -4px 0px 0px #0080ff;
	    background: var(--system-page-content-wrapper-bgc);
	    border-radius: 4px 4px 0px 0px;	    
		transform: scale(1);
		animation: myscale 0.4s;
		opacity: 1;
	}

	/*表单打开动画*/
	@keyframes myscale {
		0% {
			opacity: 0;
			transform: scale(0.6);
		}

		100% {
			opacity: 1;
			transform: scale(1);
		}
	}

	/*表单关闭样式及动画*/
	.open-content-hide {
	    width: 100%;	   
	    box-shadow: 0px -4px 0px 0px #0080ff;
	    background: var(--system-page-content-wrapper-bgc);
	    border-radius: 4px 4px 0px 0px;	    
		animation: myscalehide 0.4s;
		transform: scale(0.6);
		opacity: 0;
	}

	@keyframes myscalehide {
		0% {
			opacity: 1;
			transform: scale(1);
		}

		100% {
			opacity: 0;
			transform: scale(0.6);
		}
	}

.header {
  display: flex;
  justify-content: space-between;
  height: 40px;
  line-height: 40px;
  background: var(--win-head-back-color);
  margin: 4px;
  text-align: left;
}
.header .title {
  width: calc(100% - 25px);
  height: 40px;
  line-height: 40px;
  font-size: 16px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: var(--system-page-topbar-text-color);
  margin-left: 12px;
}
.header .close {
  font-size: 12px;
  width: 12px;
  height: 12px;
  margin-right: 9px;
}

.dialog-body {  
  color: var(--system-page-topbar-text-color);
}
/*element 输入框样式*/
>>> .el-input__inner {
  line-height: 32px;
  height: 32px;
  width: 227px;
  border: 1px solid var(--input-border-color);
  border-radius: 4px;
  color: var(--input-text-color);
  font-size: 14px;
  font-family: Microsoft YaHei;
  font-weight: 400;
}
/*element 下拉框*/
>>> .el-input__inner:focus {
  border: 1px solid var(--input-focus-border-color);
}
/*下拉框箭头*/
>>> .el-select__caret {
  line-height: 32px;
}
>>> .el-select {
  width: 227px;
}
/*element 输入框的 focus hover样式*/
>>> .el-input__inner:focus,
>>> .el-textarea__inner:focus {
  background: var(--input-focus-back-color);
  border: 1px solid var(--input-focus-border-color);
  border-radius: 4px;
}

>>> .el-input__inner:hover,
>>> .el-textarea__inner:hover {
  background: var(--input-hover-back-color);
  border: 1px solid var(--input-focus-border-color);
}
>>> .el-textarea__inner {
  color: var(--input-text-color);
  font-size: 14px;
  font-family: Microsoft YaHei;
  font-weight: 400;
}
.footer {
  padding-right: 20px;
  height: 60px;
  line-height: 60px;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin-bottom: 20px;
}
</style>